/**
 * 辖区模型
 */
class Region extends CommonModels {
    tableFields() {
        return {
            "province": {
                "label": "省",
                "type": "varchar(50)"
            },
            "city": {
                "label": "市",
                "type": "varchar(50)"
            },
            "area": {
                "label": "区县",
                "type": "varchar(50)"
            },
            "street": {
                "label": "街道",
                "type": "varchar(50)"
            },
            "province_name": {
                "label": "省",
                "type": "varchar(50)"
            },
            "city_name": {
                "label": "市",
                "type": "varchar(50)"
            },
            "area_name": {
                "label": "区县",
                "type": "varchar(50)"
            },
            "street_name": {
                "label": "街道",
                "type": "varchar(50)"
            },
            "level": {
                "label": "辖区等级",
                "type": "tinyint(1)"
            },
            "note": {
                "label": "备注",
                "type": "varchar(500)"
            }
        }
    }

    /**
     * 实现数据验证
     * 需要数据写入，必须在rules添加对应规则
     * 在控制中执行[模型]->attributes = $postData;
     * 否则会导致验证不生效，并且写入数据为空
     * @return [type] [description]
     */
    rules() {
        return {
            
        }
    }

    /**
     * 表名称
     * @returns {string}
     */
    tableName() {
        return '{{%region}}';
    }

}

export default Region;